import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

// 获取用户信息
export function getInfo(data) {
  return request({
    url: '/admin/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}

export function getAllAdmin() {
  return request({
    url: '/admin/allAdmin',
    method: 'post'
  })
}

export function modifyAdminInfo(data) {
  return request({
    url: '/admin/modifyAdminInfo',
    method: 'post',
    data
  })
}

export function addUser(data) {
  return request({
    url: '/admin/addUser',
    method: 'post',
    data
  })
}

export function delAdmin(data) {
  return request({
    url: '/admin/delAdmin',
    method: 'post',
    data
  })
}
